package cn.hk.cancel.controller;

import cn.HK.vo.SystemResult;
import cn.hk.cancel.service.OrderCancelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderCancelController {
    @Autowired
    private OrderCancelService orderService;
    @RequestMapping(value = "/order/cancel",method = RequestMethod.GET)
    public SystemResult cancelOrder(Integer uId,Integer oId) {
        try {
            orderService.cancelOrder(uId, oId);
            return SystemResult.ok();
        } catch (Exception e) {
            e.printStackTrace();
            return SystemResult.build(201, "取消订单失败", null);
        }
    }
}
